export default {
  state: {
    isExpand: true, //是否展开菜单栏
    //是否暗黑模式
    isDark: localStorage.getItem("vueuse-color-scheme") === "dark",
    loginPic: true,
  },
  mutations: {
    //和state一一对应，控制状态变化
    updateIsExpand(state, flag) {
      localStorage.setItem("isExpand", !state.isExpand);
      state.isExpand = !state.isExpand;
    },
    setIsDark(state, theme) {
      state.isDark = theme;
      state.loginPic = theme;
    },
  },
};
